<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="zozopo.operations.comm.*" %>
<%@taglib prefix="s" uri="/struts-tags"%>

<%@page import="zozopo.operations.manual.*" %>
<%@page import="zozopo.operations.business.*" %>
<%@page import="zozopo.database.*" %>
<%@page import="java.sql.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>修改主题 - <s:property value="release.release_subject"/> </title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="修改主题 Zozopo">
<link rel="stylesheet" href="css/site.pack.css" type="text/css" />


<style>
<!--
table {
table-layout: fixed;
word-wrap:break-word;
}
td{	
	word-break:break-all;
}
div { 
word-wrap:break-word;
}

.whasiCSS {
	PADDING-RIGHT: 0px; OVERFLOW-Y: hidden; PADDING-LEFT: 0px; FONT-SIZE: 16px; PADDING-BOTTOM: 0.18em; WIDTH: 28em; COLOR: #bebebe; MARGIN-RIGHT: 8px; PADDING-TOP: 0.18em; HEIGHT: 21px
}
//-->
</style>
<script type="text/javascript" src="../comm/editor/editor.js" charset="gb2312"></script>

<script type="text/javascript" src="../jquery/js/jquery-1.4.2.min.js"></script>

<link type="text/css" href="../jquery/themes/base/jquery.ui.all.css" rel="stylesheet" />
	<script type="text/javascript" src="../jquery/ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../jquery/ui/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../jquery/ui/jquery.ui.position.js"></script>
	<script type="text/javascript" src="../jquery/ui/jquery.ui.autocomplete.js"></script>
	<link type="text/css" href="../jquery/themes/cupertino/jquery-ui-1.8.4.custom.css" rel="stylesheet" />
	<link type="text/css" href="../jquery/demos.css" rel="stylesheet" />
	
	
	  <%
    BusiDatabaseManager databaseConnection = new BusiDatabaseManager();
	Connection conn = databaseConnection.getConnection();
    DictionaryOS dictionaryOS = new DictionaryOS(conn);
    StoreOS storeOS = new StoreOS(conn);
    BrandlogoOS brandlogoOS = new BrandlogoOS(conn);
%>

<script type="text/javascript">
	//加入输入框索引
	$(function() {
		var names = [<%
 		List<String> brandList = storeOS.selectCnbrandList(0,100); 
								boolean isfirst = true;
 					     		for(String brand:brandList){
 					     			if(!isfirst){
 					     				%>,"<%=brand%>"<%
 					     			}else{
 					     				isfirst = false;
 					     				%>"<%=brand%>"<%
 					     			}
								   }
								     	%>];

		var accentMap = {
			'á':'a',
			'?':'o'
		};
		
		var normalize = function( term ) {
			var ret = '';
			for ( var i = 0; i < term.length; i++ ) {
				ret += accentMap[ term.charAt(i) ] || term.charAt(i);
			}
			return ret;
		};

		$( "#brand" ).autocomplete({
			source: function( request, response ) {
				var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
				response( $.grep( names, function( value ) {
					value = value.label || value.value || value;
					return matcher.test( value ) || matcher.test( normalize( value ) );
				}) );
			}
		});
	});

	$(function() {
		var names = [<%
 		List<String> enbrandList = storeOS.selectEnbrandList(0,100); 
								boolean isfirst2 = true;
 					     		for(String brand:enbrandList){
 					     			if(!isfirst2){
 					     				%>,"<%=brand%>"<%
 					     			}else{
 					     				isfirst2	 = false;
 					     				%>"<%=brand%>"<%
 					     			}
								   }
								     	%>];

		var accentMap = {
			'á':'a',
			'?':'o'
		};
		
		var normalize = function( term ) {
			var ret = '';
			for ( var i = 0; i < term.length; i++ ) {
				ret += accentMap[ term.charAt(i) ] || term.charAt(i);
			}
			return ret;
		};

		$( "#secondbrand" ).autocomplete({
			source: function( request, response ) {
				var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
				response( $.grep( names, function( value ) {
					value = value.label || value.value || value;
					return matcher.test( value ) || matcher.test( normalize( value ) );
				}) );
			}
		});
	});

</script>
  </head>
  
  <body>
  <jsp:include page="head.jsp"></jsp:include>
 <form name="modifyForm"  id="modifyForm" method="post" action="modifyrelease.action"  accept-charset="UTF-8" >
 <input name="id" id="id" value="<s:property value="release.release_id" />" type="hidden"/>
 <s:token />
  <div class="nabble" id="nabble">
    <table width="100%"  border="0" cellpadding="0" cellspacing="0">

    <tr valign="top">
    	<td width="270" align="right">
    		
    		
    		
    	</td>
    	<td width="100%" >
    		
    	</td>
    </tr>
    
    <tr valign="top">
     	<td >
     		
		   <table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
				<tr >
					<td >
							   相关数据
					</td>
				</tr>
			</table>
			<div id="related">
				<table>
						<tr >
							<td >
								<font color="blue">发布日期:</font><s:property value="release.release_date"/>
							</td>
						</tr>
						<tr >
							<td >
								修改日期: <s:property value="release.release_md_date"/>
							</td>
						</tr>
						
						<tr >
							<td >
							
								<font color="blue">作者:</font><s:property value="release.release_useremail"/>
							</td>
						</tr>
								
						
						
						<tr >
							<td >
								浏览量: <s:property value="release.release_views"/>
							</td>
						</tr>
						
							<tr >
								<td >
									回复量: <s:property value="release.release_replys"/>
								</td>
						</tr>
						
						<tr >
							<td >
								主题状态: <s:property value="release.release_state"/>
								
							</td>
						</tr>
						
						<tr >
							<td >
								支持数: <s:property value="release.release_bear"/>
								
							</td>
						</tr>
						
						<tr >
							<td >
							
								<font color="blue">IP:</font> <s:property value="release.release_ip"/>
							</td>
						</tr>
						
						
						
						<tr >
							<td >
							
								
							</td>
						</tr>
					
				</table>
			</div>
			<jsp:include page="/user/left.jsp"></jsp:include>
     	</td>
     
    <td>
<table width="100%"  border="0" cellpadding="0" cellspacing="0" >


<tr>
	<td>
		<table width="100%"  border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
		<tr >
			<td width="100%">
			内容:
			</td>
			<td align="right">
				
			</td>
		</tr>
		</table >
	</td>
</tr>

<tr>
	<td>
		<table width="100%"  border="0" cellpadding="0" cellspacing="0" >
				<tr>
									<%
										//DictionaryOS dictionaryOS = new DictionaryOS();
										Map dictionaryLableMap = dictionaryOS.getDictionaryLableMap();
									%>
					<td width="100%" >
					<s:fielderror id="errormessage" />
		    			标题:<input tabindex="1" size="60"  name="subject" id="subject" type="text" value="<s:property value="release.release_subject"/>" /> 
		    				
		    					
										
									<input type="radio" id="kind" name="kind" value="" >普通主题</input>
									<input type="radio" id="kind" name="kind" value="KIND.DISCERN">真假辨别 </input>
									<input type="radio" id="kind" name="kind" value="KIND.NEWGOODS">新品上架 </input>
								<s:if test="%{#session.userInfo != null}">
								 	<s:if test="%{#session.userInfo.user_limitflag.charAt(1) == '1'}">
								 		<input type="radio" id="kind" name="kind" value="KIND.RECOMMENDSTORE">正品推荐 </input>
								 	</s:if>
								 </s:if>		
					</td>
				</tr>
				<s:if test="%{#session.userInfo != null}">
						<s:if test="%{#session.userInfo.user_limitflag.charAt(4) == '1'}">
						<tr><td>
								
								<s:if test="%{#session.userInfo != null}">
								 	<s:if test="%{#session.userInfo.user_limitflag.charAt(1) == '1'}">
								 		URL:<input tabindex="1" size="60"  name="url" id="url" type="text" value="<s:property value="release.release_url"/>" /> 
								 	</s:if>
								 </s:if>
								 <s:else>
								 		<input tabindex="1" size="60"  name="url" id="url" type="hidden" value="<s:property value="release.release_url"/>" /> 
								 </s:else>
							</td>
						</tr>
						</s:if>
						<tr>
							<td>
								图标:<input tabindex="1" size="60"  name="image" id="image" type="text" value="<s:property value="release.release_image"/>" /> 
								<input type="button" value="插入图标" onclick="javascript:insertIconUrl(window.showModalDialog('addalbumicon.action','son','DialogWidth:800px;DialogHeight:600px;')); "/>
							</td>
						</tr>
				</s:if>
				
				<tr><td>
			    		标签:
								
									<%
										
										Iterator iter = dictionaryLableMap.entrySet().iterator();
										while(iter.hasNext()){
											Map.Entry entry = (Map.Entry)iter.next();
											DictionaryTB dictionary	= (DictionaryTB)entry.getValue();
											
											//if(dictionary.getDictionary_code().equals("MANUAL.LABLE.OTHER")) continue;
									%>
										<input type="radio" id="lable" name="lable" value="<%=dictionary.getDictionary_code() %>"><%=dictionary.getDictionary_value() %></input>
									<%
									
										}
										dictionaryOS.releaseConnection();
									%>
			    		</td></tr><tr><td>
			    		品牌(中文): <input id="brand" name="brand" type="text" maxlength="64" value="<s:property value="release.release_brand"/>"/>
			    		
			    		品牌(英文): <input id="secondbrand" name="secondbrand" type="text" maxlength="64" value="<s:property value="release.release_secondbrand"/>"/>
			    		<font color="red"> *(第二品牌称呼 如:vans是主要品牌，万斯则是第二品牌称呼) </font>
			    	</td>
				</tr>
		
		</table>
	</td>
</tr>

<tr>
	<td>
		<table align="left"  border="0"  cellspacing="0" cellpadding="0">
    	
     		<tr>
     			<td>
     			
     			
     			<div class="editPane" style="width:100%px;overflow: hidden;border: 1px solid #0275BF;background:#e0f4ff;">
     			<img src="../comm/editor/toolbar.start.gif" align="absmiddle" />
     			<button onclick="javascript:insertImage(window.showModalDialog('addalbumimage.action','son','DialogWidth:800px;DialogHeight:600px;'));" >插入图片</button>
     			</div>
     			
     			<div class="m950 lineDarkBlue"></div>
     			<textarea name="context" id="context" class="editArea" require="true" datatype="LimitB" min="3" max="30000"  msg="商品详细描述必须在[3～30000]个字符之内,一个中文是两个字符!" rows="1" cols="25" >
					      <s:property value="release.release_context" escape="false"/>
				</textarea>
					    <script language="javascript">      
					// 安装编辑器
					oEditor = new PPEditor( 'context' );
					oEditor.ToolbarSets    = [['Source'],['Bold','Italic','Underline','StrikeThrough'],['SubScript','SuperScript'],['InsertOrderedList','InsertUnOrderedList'],['JustifyLeft','JustifyCenter','JustifyRight'],['CreateLink','UnLink'],['InsertImage'],['TextColor','BGColor'],['FontName','FontSize'],['WordCount']] ;
					oEditor.Create() ; 
					</script>
					<img alt="" src="../comm/editor/auction_ruler.png">
				</td>
     		</tr>
     	</table>
	</td>
	
</tr>


<tr>
	<td>
		<table width="100%"  border="0" cellpadding="0"  cellspacing="0" rules="all">
		<tr>
			<td>
				
		
	
						<input type="submit" value="确认修改" onclick="submitType('submittype')"/>
						或 <a href="../manual/">取消</a> 
					
				</td>
			</tr>
			
			<tr>
				<td >
					
				</td>
			</tr>
			
			<tr>
				<td width="100%" align="center">
				
				</td>
			</tr>
			
		</table>
	</td>
</tr>
<tr>
	<td></td>
</tr>
<tr>
	<td></td>
</tr>

</table>
	
	
	
	</td>
  </tr>
</table>
    </div>
    </form>
    <table align="center">
	<tr>
		<td>
			<jsp:include page="tail.jsp" ></jsp:include>
		</td>
	</tr>
	</table>
	
  </body>
  <script type="text/javascript">
 	radio_oj = modifyForm["lable"];

 	 for(var i=0;i<radio_oj.length;i++) //循环
 	   {
 	   if(radio_oj[i].value=='<s:property value="release.release_lable"/>') //比较值
 	   { 
 	 	   	//alert(radio_oj[i].value);
 			radio_oj[i].checked=true; //修改选中状态
 	  	    break; //停止循环
 	   }
 	}
  	
 	radio_kind = modifyForm["kind"];

	 for(var i=0;i<radio_kind.length;i++) //循环
	   {
	   if(radio_kind[i].value=='<s:property value="release.release_kind"/>') //比较值
	   { 
	 	   	//alert(radio_oj[i].value);
			radio_kind[i].checked=true; //修改选中状态
	  	    break; //停止循环
	   }
	}

function submitType(submittype){


	
	
}//*/

function insertIconUrl(iconurl){
	//alert(iconurl);
	if(iconurl != undefined){
		 modifyForm["image"].value=iconurl;
	}
	
	// opener.
	 
};

function insertImage(imageurl){
	//alert(imageurl);
	 //modifyForm["context"].value=imageurl + modifyForm["context"].value;
	 if(imageurl != undefined){
		oEditor.SaveSelection();
		oEditor.Editor.focus();
		oEditor.ReSelect();
		oEditor.InsertHTML(imageurl);
	 }
	// opener.
	 
};

</script>
<%
	databaseConnection.releaseConnection(conn);
%>
</html>
